home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
FROMUTS
/
GRAPHDRAW
/
!GraphDraw
/
!Help
< prev
next >
Wrap
Text File
|
1990-11-19
|
14KB
|
375 lines
!GraphDraw, © Chris Johnson, 1990
These user notes refer to version 0.9 (July 1990) only.
*********************************************************
ACKNOWLEDGEMENT
THIS PROGRAM WAS COMPILED USING THE DABS PRESS ARCHIMEDES
BASIC COMPILER (ABC)
*********************************************************
What this software does
=======================
It allows the entry of the x and y values for a number of
data, and the data may then be fit to
a. best straight line
b. best parabola
c. a cubic spline curve
d. a polynomial of order up to 6
A number of options for obtaining various forms of hard copy
exist (saving as a sprite file, saving as a !Draw file, or
printing via any standard RISC-OS printer driver).
Use of !GraphDraw
=================
Running the application
-----------------------
This software is fully RISC-OS compatible, and is
multi-tasking. It can be run from the desktop in all the
standard ways.
NB. The display of the graph uses outline fonts to annotate
the axes etc.. It is therefore necessary for the operating
system to have "seen" the !fonts directory before the
program is run. Otherwise an error message may be generated.
The default font used is Trinity.Medium, since this comes on
the RISC-OS applications disc, and both old and new version
font managers can deal with it (the new outline font manager
will work with the old bitmapped fonts).
Double clicking on the !GraphDraw icon in a directory viewer
will install its icon on the icon bar. Clicking 'menu' on
this icon will lead to a menu providing
1. a standard information window with version number
2. the opportunity to quit the application.
Clicking 'select' will open an empty edit window, into which
the pairs of x,y data may be entered. This version allows a
maximum of 40 data point pairs. Full scrolling and editing
facilities are available during data entry. Remember to
press <RETURN> when editing the contents of a particular
slot to enact the change.
The application can also be started by double clicking on a
data file of the correct format. In this case, besides the
icon appearing on the icon bar, the edit window will be
opened with the contents of the data file displayed, for
further editing if necessary. A data file may also be
dragged, either into the edit window, or to the iconbar
icon. The data will be loaded, overwriting any data that had
previously been entered.
Data can also be passed in either direction between the
GraphDraw edit window and a !edit window. Thus editing can
be carried out using the !edit application if preferred.
Data can be entered 'from scratch' using !edit, and then
transferred to the !GraphDraw application (by dragging a
save icon to its edit window or its iconbar icon), as long
as the !GraphDraw application can recognise a valid data
file. This version of !GraphDraw takes the easy way out and
uses the <wimp$scrap> file passing protocol with a temporary
disc file. Users of single floppy disc machines may be
prompted for the disc on which the <wimp$scrap> file is to
be saved (by default in the !system directory). [HINT: It is
possible to redirect the <wimp$scrap> file to the RAM disc,
for example. This will prevent disc swapping, and is very
fast. It requires that a RAM disc is always configured.] It
is intended that the next version will use direct memory
transfer for these operations. As the graphdraw application
will deal with files of comma separated ASCII data it is
possible to set up other applications to produce data files
of the correct form.
The !GraphDraw edit window menu
===============================
All of the data processing and data display facilities are
accessed from the edit window menu.
Clicking the 'menu' button in the edit window brings up the
following choices.
Info
----
The standard information window.
Clear data
----------
This will irretrievably clear the current data prior to the
entry of new data.
Save file
---------
Data files may be saved by dragging the save icon to a
directory viewer. If the full path name is set up, then you
can also click on the OK icon to save the data.
It is also possible to drag the save icon to a !Edit window,
or to the !Edit icon on the iconbar. The data is then
transferred into !Edit.
Plot points
-----------
This will simply plot a scaled graph of the data.
Best line
---------
This will carry out a standard linear regression by the
least squares method to calculate the best fit straight line
through the data. A window will open displaying the slope,
intercept on y axis, correlation coefficient and the
standard errors of the slope and intercept. Clicking 'menu'
in this window allows the following choices.
Graph
-----
This will display a graph of the data points with the
calculated best line superimposed. Clicking 'menu' in the
graph window leads to a further set of options (see below
under cubic spline).
Print data
----------
This will send the results of the calculation to any
printer connected to the computer. The individual errors
calculated for each data point are also printed.
Parabola
--------
This will carry out a least squares fit of the data to the
equation of a parabola
y = u + vX + wX^2.
This is a useful technique for fitting data to a simple
curve. A window will open showing the calculated values of
the coefficients u, v and w. Clicking 'menu' in this window
will bring up the same two options as described above, i.e.
graph and Print data.
Polynomial
----------
This will carry out a standard polynomial fit for orders 3
to 6. Some of the higher order options may be greyed out if
there are not enough data points. Selecting a particular
order will force the program to calculate that specific
order polynomial, whereas if 'All' is selected, the program
will try all possible orders (3 to 6) and report the one
which gives the smallest deviation. A window will open
showing the results of the calculation, and clicking 'menu'
on this window leads to the same options as above.
Cubic spline
------------
This will display a graph of a smooth cubic spline through
all the data points. It is based upon an algorithm in
"Numerical Methods" by Press et al. For this plot, it
requires all the data to be sorted in order. The program
automatically sorts the data in ascending order of x values
before carrying out the spline routine. This version plots a
natural spline curve through all the data points.
The next version will allow the 'degree of smoothness' to be
specified, so that experimental scatter in the data set may
be allowed for.
Graph window menus
==================
Whenever a graph is being displayed, clicking 'menu' will
lead to a further range of options. Some of these are common
to all the graph types, others are specific to cubic spline.
Rather than repeat the same thing several times over, all
the common options are dealt with here.
The common options
------------------
Screensave
----------
This saves the whole graph screen as a sprite, which can
then be loaded into !Paint, or !Draw for example. The screen
can be printed from either of these utilities using the
RISC-OS printer drivers. There is no choice in filename - it
saves in the current directory using grafwinN, where N is a
decimal number which increments with each save. It defaults
to 1 each time the program is run, thus any existing files
from a previous session will be overwritten if there are any
in the current directory
Legend
------
This opens a window which allows you to enter text to label
the graph axes, and a title string for the graph. Clicking
on display will place the labels on the graph, while delete
will remove labels from the graph (the text remains in
memory and can be reinstated by reselecting label and
clicking on display). Simply closing the menu will leave the
state of the labels as they were.
The labels are dragable icons and can thus be dragged to
anywhere on the graph if you dont like the default
positions. The same labels will appear on any graph, with
the previous position being remembered. The y-axis label is
plotted vertically, reading downwards. This is something I
am not too sure about as far as the aesthetics of display
are concerned. I have not yet worked out how to rotate
outline font text through 90 degrees so that it reads up the
axis! [HINT: If you have FontFX, then you can use this to
convert the outline font to draw files that can be rotated.
Save the graph as a draw file, and then import the y-axis
legend from FontFX.]
If data is saved after legends have been entered, then the
text is also saved, and is reloaded when the data is
reloaded.
Layout
------
This leads to a dialogue window in which various aspects of
the way the graph is laid out may be changed, e.g. whether
the axis pips are inside, outside or straddle the axis
lines, the size of the pips, whether the graph is boxed in,
and the type of symbol used for the data points. These
aspects are under continuous development, and will be
enhanced in future releases. (Note that the size of the pips
is related to the size of the divisions on the other axis)
Make Drawfile
-------------
A standard 'save as' dialogue box will be opened. The file
icon may be dragged to a directory viewer, or if the full
filename path is set up it is possible to click on OK. The
file saved is a Drawfile of the graph being displayed. This
file can then be loaded into !Draw for further enhancement.
It is also permissible to drag the file icon into a !draw
window to add the graph to an existing draw document, or
drag the icon to the !draw icon on the iconbar, when a new
draw window will be opened. These latter operations make use
of the wimp$scrap protocol in the present version - direct
memory to memory transfer is to come! The production of
!Draw format files means that the graphs can be loaded into
!Draw for enhancement, and can also be loaded into the
various DTP packages now available (it certainly works for
Acorn DTP and Beebug's Ovation packages).
When it is first loaded into !draw, the whole graph appears
as one object, and may be scaled, moved, etc. as a whole.
The line thickness may be changed, or even the font used may
be altered. However, in the latter case, you may find that,
if the font metrics are very different to Trinity, then the
alignment and centring of text is incorrect. [I hope the
next improvement to !graphdraw will allow the outline font
to be changed from within !graphdraw.] The objects making up
the graph may be ungrouped in the normal way. This allows
adjustment of individual parts of the graph, or annotation.
It needs care when dealing with the individual parts of the
graph, otherwise you may inadvertantly move parts of the
axis for example, or even the graph itself, and have great
trouble getting it back to the correct place.
If you are familiar with using !draw, then it should be easy
to play around with the draw files output by !graphdraw.
Print Graph
-----------
Choosing this option gives a printout of the complete graph
via whichever printer driver application is installed. A
printer driver must be installed, otherwise !Graphdraw will
complain. This allows a much higher quality hard copy to be
obtained compared to a simple screen dump, up to the best
available resolution of the printer used.
Cubic Spline option only
------------------------
Interpolate
-----------
This option is available ONLY from the cubic spline graph,
and allows the interpolation of single values, or the
dumping of a range of values to the printer. Note that it is
not possible to extrapolate the spline curve beyond either
of the end points.
*************************************************************
The software referred to in these notes is NOT placed into
the public domain, but remains the copyright of the author,
Chris Johnson. It is released for distribution by Norwich
Computer Services under their Shareware/Careware scheme
only, and should not be posted on bulletin boards or
circulated on any public domain software discs, except by
prior and express agreement with the author, or with Norwich
Computer Services.
Anyone obtaining this software by any means other than
direct purchase from Norwich Computer Services and making
use of the software other than for trial purposes, is
requested to register with the author by sending £3 (most
of which will find its way to an approved charity), or to
send a donation to charity directly to NCS. All users
registering directly with the author will be informed from
time to time of any significant improvements or 'bug' fixes
and will be entitled to upgraded versions of the software
free of charge by sending a blank disc.
The software is supplied as is, and no warranty, either
express or implied, is given as to the suitability of the
software for any purpose.
Notwithstanding the above, the author would, of course, be
interested in hearing of any 'bugs' or any other unexpected
features, and will endeavour to correct any such 'bugs' so
reported in any future issues of this software. Suggestions
for improved features are also most welcome. Implementation
of suggestions depends of course on practicability and more
importantly, the authors spare time (I do have a full time
job!).
If you have any comments on this program, or would like to
suggest ways in which it could be improved then the author
can be contacted directly.
Chris Johnson
7 Lovedale Grove
Balerno
Edinburgh
EH14 7DR
If you wish to enter into the 'shareware' concept in the
full sense then registrations (>=£3) will be gratefully
received by the author.
If, in any communication, you make specific reference to the
program code, then please
(a) quote the version number and date
(b) refer only to the program as issued.
(c) supply as many details as possible about the
problem, and indicate the hardware configuration of
the machine being used.
PLEASE SEND A STAMPED AND SELF ADDRESSED ENVELOPE IF YOU
REQUIRE A REPLY.
I hope you find the program of some use.
CafJ 02/11/1990